SlideShare a Scribd company logo
1 of 39
CSS for Text and Backgrounds Colin Gourlay & Kevin Vanderbeken
Today: Web Typography Styling Text Styling Backgrounds Styling Links
web typography
limitations ,[object Object]
No hyphenation
Poor control over kerning
A lack of control over how the work is viewed,[object Object]
legibility & readability
serif / sans-serif / etc.
how many pixels in a centimeter?
styling text
Know the text related elements? The good: <br /> <h1></h1> .. <h6></h6> <p></p> <a></a> <sub></sub> <sup></sup> <tt>Teletype text</tt> <u></u> <li></li> <ol></ol> <blockquote></blockquote> <code></code> <kbd></kbd> <samp></samp> ...And more more more!... The ugly: <i>Italic text</i> <b>Bold text</b> <big>Big text</big> <small>Small text</small> The bad: <applet></applet> <basefont /> <center></center> <dir></dir> <font></font> <embed /> <noembed></noembed> <layer></layer> <menu></menu> <s></s> <strike></strike> <xmp></xmp> <u></u> <shadow></shadow>
We write our CSS styling rules: By attaching a base rule we can override elsewhere to the body, we reduce work, and utilise inheritance. body {     color: #000000;     font-family: Helvetica, Arial, sans-serif;     font-size: 12px; } p { color: #333; } h1, h2, h3 { color: #1B87A4; }; Now for more detail on styling...
font, colour & size
Font, “color” & size: For text related elements there are properties we can use to control the basics – font, colour and size... p {     font-family: “Helvetica Neue”, Arial, sans-serif; color: #000000;     /*Lets get a little silly...*/     font-size: 1.875em; /*Desired size in px (30px) / Default inherit size(16px)=1.875em */ font-size: 1en;   /*Half of an em!*/ font-size: 150%;  /*easy to understand relative unit*/     font-size: 12pt;  /*yaddayadda*/ font-size: 0.8cm; /*Works! But doesn’t get used for screen - unpredictable!*/     font-size: 18px;  /*Quite defined but less scaling*/      /*etc etc*/ }
Font, “color” & size: The Web Fonts... In the degrading pattern of similar families: ,[object Object]
"Arial Black", Gadget, sans-serif
"Comic Sans MS", cursive
"Courier New", Courier, monospace
Georgia, serif
Impact, Charcoal, sans-serif
"Lucida Console", Monaco, monospace
"Lucida Sans Unicode", "Lucida Grande", sans-serif
"Palatino Linotype", "Book Antiqua", Palatino, serif
Tahoma, Geneva, sans-serif
"Times New Roman", Times, serif
"Trebuchet MS", Helvetica, sans-serif
Verdana, Geneva, sans-serif
Symbol,
Webdings,
Wingdings, "Zapf Dingbats"
"MS Sans Serif", Geneva, sans-serif
"MS Serif", "New York", serif,[object Object]
Emphasis and transformation: ... p {     font-weight: bold;/*normal,900,300,etc*/ text-decoration: underline; /*overline,line-through,blink*/ font-style: italic; /*normal,oblique*/ text-transform: capitalize; /*uppercase,lowercase*/ }
alignment & justification
Alignment and justification: ... div {     text-align: left;/*center,right,justified*/ }
styling backgrounds
<ahref="brochure.pdf"class="pdf"> 	Download Brochure </a> Download Brochure
image & colour

More Related Content

Viewers also liked

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
1 06-more html-elements
1 06-more html-elements1 06-more html-elements
1 06-more html-elementsapnwebdev
 
Back to the Basics - 2 - HTML & CSS
Back to the Basics - 2 - HTML & CSSBack to the Basics - 2 - HTML & CSS
Back to the Basics - 2 - HTML & CSSClint LaForest
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introductionapnwebdev
 
1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioningapnwebdev
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgroundsapnwebdev
 
1 07-the box-model
1 07-the box-model1 07-the box-model
1 07-the box-modelapnwebdev
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elementsapnwebdev
 
1-04: HTML Elements
1-04: HTML Elements1-04: HTML Elements
1-04: HTML Elementsapnwebdev
 
Javascript and Jquery: The connection between
Javascript and Jquery: The connection betweenJavascript and Jquery: The connection between
Javascript and Jquery: The connection betweenClint LaForest
 
Web programming and development - Introduction
Web programming and development - IntroductionWeb programming and development - Introduction
Web programming and development - IntroductionJoel Briza
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Developmentapnwebdev
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elementsapnwebdev
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Modelapnwebdev
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first courseVlad Posea
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programmingStoian Kirov
 
Introduction to Web Programming
Introduction to Web ProgrammingIntroduction to Web Programming
Introduction to Web ProgrammingYnon Perek
 
WEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentWEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentRandy Connolly
 

Viewers also liked (20)

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
1 06-more html-elements
1 06-more html-elements1 06-more html-elements
1 06-more html-elements
 
Back to the Basics - 2 - HTML & CSS
Back to the Basics - 2 - HTML & CSSBack to the Basics - 2 - HTML & CSS
Back to the Basics - 2 - HTML & CSS
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introduction
 
1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning1 07-2-css floats-and_positioning
1 07-2-css floats-and_positioning
 
Introduction To Web Development Course
Introduction To Web Development CourseIntroduction To Web Development Course
Introduction To Web Development Course
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds
 
1 07-the box-model
1 07-the box-model1 07-the box-model
1 07-the box-model
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elements
 
1-04: HTML Elements
1-04: HTML Elements1-04: HTML Elements
1-04: HTML Elements
 
Javascript and Jquery: The connection between
Javascript and Jquery: The connection betweenJavascript and Jquery: The connection between
Javascript and Jquery: The connection between
 
Web programming and development - Introduction
Web programming and development - IntroductionWeb programming and development - Introduction
Web programming and development - Introduction
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Development
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elements
 
introduction to web application development
introduction to web application developmentintroduction to web application development
introduction to web application development
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Model
 
Introduction to Web Programming - first course
Introduction to Web Programming - first courseIntroduction to Web Programming - first course
Introduction to Web Programming - first course
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
 
Introduction to Web Programming
Introduction to Web ProgrammingIntroduction to Web Programming
Introduction to Web Programming
 
WEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentWEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web Development
 

Similar to 1 05-css for-text_and_backgrounds

How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksCompare Infobase Limited
 
CSS For Online Journalism
CSS For Online JournalismCSS For Online Journalism
CSS For Online Journalismamherstwire
 
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)Tom Hapgood
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglKilian Valkhof
 
Web design
Web designWeb design
Web designmjk194
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 PresentationMichael Gwyther
 
Using HTML5 and CSS3 today
Using HTML5 and CSS3 todayUsing HTML5 and CSS3 today
Using HTML5 and CSS3 todaythebeebs
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Mark Wubben
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practicessachin9737
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practicesguest3ebcca
 
Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Edwin Vijay R
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technologyvikram singh
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSSTodd Anglin
 

Similar to 1 05-css for-text_and_backgrounds (20)

How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
 
CSS For Online Journalism
CSS For Online JournalismCSS For Online Journalism
CSS For Online Journalism
 
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webgl
 
Web design
Web designWeb design
Web design
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
AK css
AK cssAK css
AK css
 
Using HTML5 and CSS3 today
Using HTML5 and CSS3 todayUsing HTML5 and CSS3 today
Using HTML5 and CSS3 today
 
Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
CSS
CSSCSS
CSS
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>
 
Estilos Css
Estilos CssEstilos Css
Estilos Css
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)Visualforce css developer guide(by forcetree.com)
Visualforce css developer guide(by forcetree.com)
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 

1 05-css for-text_and_backgrounds

Editor's Notes

  1. On the Web, designers have much less control over presentation than they do in other media. This is most obvious when it comes to document canvas properties such as size, resolution, and contrast. There are also severe limitations on the quality of Web typography.
  2. Limitations of web typography include:A reduced selection of fontsNo hyphenation, making full justification look ugly when a column of text gets narrowPoor control over kerning (ie, the spacing between the letters)A lack of control over how the work is viewed—designers must account for a wide variety of screen sizes, resolutions and environmentsOther subjects that deserve an introduction are contrast, legibility, and readability, so we&apos;ll go through these now...
  3. As you already learned earlier on in the course, one of the most important changes that comes with CSS was the ability to separate presentation, or the way things look, from semantics, or what things mean. The CSS background image is among the most important tools you have at your disposal, because it lets you apply decorative images to particular parts of your HTML without adding any extra weight to your HTML. Previously, authors (that’s you!) were forced to fill their code with img tags.CSS and in particular the background property keep your HTML free from presentational clutter. Redesigns and other transitions, in the life of sites built with modern methods, can then be completed much more smoothly. You’ll be able to update your entire site by changing only the style sheet, rather than recoding every HTML page. Depending on the size of your site, this can be a substantial saving.In this section we’ll show the basics of how CSS background images work, including applying a background image via CSS, adjusting its placement as well as tiling it vertically or horizontally.
  4. Set the background-image by showing the browser where to find the image, using the URL. For example; url(alert.png). Note that the path is prefaced with they keyword url and wrapped in parenthesis. This syntax is important to the browser understanding that you mean to indicate a location.Valid values include a URL, none, or inherit.There are several ways to indicate background-color, including RGB values and keywords. Most people use hexadecimal notation, a pound/hash symbol (#) followed by six characters. The first pair indicates the red levels, and the second and third indicate the green and blue levels respectively—#RRGGBB.Many colour picker tools will help you find the hexadecimal notation of a given colour. Pure red, for example would be #FF0000.
  5. Images can be tiled vertically, horizontally, or both, to fill the entire width or height of an HTML element. Use background-repeat to instruct the browser to repeat a background image.Valid values include repeat, repeat-x, repeat-y, and no-repeat.
  6. Images can be displayed anywhere within the borders of the HTML element on which they are applied. Use background-position to precisely place your images for visual effect and layering.There are many useful ways to indicate background position, keywords and numeric values. Keywords (such as top and bottom) are very useful and easy to read. Pixel values are very precise, but don’t adapt to changing heights and widths.
  7. When percentages and pixels are used, the starting point is always the top left corner of the HTML element, although the way image positioning works with pixels and percentages is rather different. Pixels always move the image a set number of pixels towards the bottom and right of the containing box (or towards the top and left if they are negative values), regardless of the size of the image and the containing box. Percentages on the other hand move the image a percentage of the difference between the containing box size, and the image size. If the image and the containing box are the same size, percentages won’t move the image at all.
  8. Valid values include length (generally in pixels), percentage (of the width of the element), and the keywords top, right, bottom, left, and center. Note that center can be used to indicate both vertical and horizontal center. Note also that you can mix percentages and pixels in rules, but not keywords and pixels or keywords and percentages.